<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"/>
    <title>忘记密码</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <script type="text/javascript" src="/h5/newall/newall.js"></script>
    <script type="text/javascript" src="/h5/js/all.js"></script>
    <link rel="stylesheet" type="text/css" href="/h5/newall/newall.css">
</head>

<div class="mui-content-padded H5body">
    <MCform id="jobForm"
            class="mctag">
        <MCtitle class="mctag">忘记密码</MCtitle>
        <div class="content">
            <div class="inputdiv ">
                <div class="mui-input-row">
                    <span class="m86">+86</span>
                    <input type="tel" id="phone" class="mui-input-clear"
                           placeholder="输入手机号" autocomplete="off"/>
                </div>
                <div class="mui-input-row password_div">
                    <input type="password" id="password" class="mui-input-clear"
                           placeholder="设置密码（6-16位数字和字母组合）"
                           autocomplete="off"/>
                </div>
                <div class="mui-input-row yam_div">
                    <input type="number" id="yam" class="mui-input-clear"
                           placeholder="请输入验证码"/>
                    <a class="codeblue huoquyzm">获取验证码</a>
                </div>


                <button class="mui-btn mui-btn-primary mui-btn-block denglubtn wanchengBtn">完成</button>

            </div>
        </div>
    </MCform>
</div>

</body>
<style>


    .yam_div .huoquyzm {
        position: absolute;
        right: 5px;
        top: 5px;
    }

    .content {
        margin: 0 auto;
        width: 80%;
        margin-top: 100px;
    }

    .m86 {
        position: absolute;
        left: 10px;
        top: 7px;
        font-size: 16px;
        font-family: PingFang-SC-Bold, PingFang-SC;
        font-weight: bold;
        color: rgba(0, 0, 0, 1);
        line-height: 22px;
    }

    #phone {
        padding-left: 50px;
    }

    .inputdiv {
        margin-top: 45px;
    }

    .zhengcelabel .codeash {
        text-decoration: underline;
    }

    .zhengcelabel {
        margin-top: 20px;
        display: block;
    }

    .denglubtn {
        margin-top: 20px;
    }

    .desc .codeblue {
        font-size: 14px;
        font-weight: 500;
        line-height: 20px;
    }

    .desc .zhuce {
        float: right;
    }
</style>
<script>
    var view = new MC.View.MCform('#jobForm');
    var logintype = 'pass';
    $('.huoquyzm').on('click', function () {
        var phone = $('#phone').val();
        if (!MC.test.regMobile(phone)) {
            return;
        }
        MC.apiD("/api/member/yzm", {
            phone: phone
        });
    });

    $('.wanchengBtn').on('click', function () {
        var phone = $('#phone').val();
        var yam = $('#yam').val();
        var password = $('#password').val();
        if(!MC.test.regMobile(phone)){
            return;
        }
        if (yam == '') {
            MC.msg.alert("验证码必须输入");
            return;
        }
        if (!MC.test.regPwd(password)) {
            return;
        }
        MC.apiD("/api/member/pwd", {
            phone: phone,
            pwd: password,
            yzm: yam
        }, function (data) {
            MC.msg.alert("已经重置密码成功,请重新登录",function () {
                window.open("/h5/login/login.html","_self");
            });
            //console.log(data);
        })
    });
</script>
</body>
</html>